<?php
/**
 * Created by PhpStorm.
 * User: alex
 * Date: 2018/11/6
 * Time: 下午9:07
 */

namespace BaseBundle\Services;
use BaseBundle\Model\m_article_class;
use RedUnicorn\SymfonyKernel\Model\Model;
use Symfony\Component\DependencyInjection\ContainerInterface;

class ArticleClassService extends BaseService
{
    /**
     * @var m_article_class
     */
    public $m_model;

    public function __construct(ContainerInterface $container = null)
    {
        parent::__construct($container);
        $this->m_model = new m_article_class($container);
    }

    public function getAllListUseSelect()
    {
        return $this->getList(
            [
                Model::R_SELECT => 'sql_pre.id,sql_pre.article_class_name',
            ],
            0,
            0
        );
    }

    public function getRecommendArticles($rule, $is_limt = 1, $is_set_list = 1)
    {
        $rule = array_merge($rule, ['is_recommend' => 1]);

        return $this->getList(
            $rule,
            $is_limt,
            $is_set_list
        );
    }
}